package com.highstockings.service.impl;

import com.highstockings.dao.UserMapper;
import com.highstockings.model.User;
import com.highstockings.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by diablo13064 on 2018/3/28.
 */
@Service("UserService")
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    public User selectUserById(int id) {
        return userMapper.selectUserInfo(id);
    }

    @Override
    public User selectUserByNamePass(String username, String password) {
        return userMapper.selectUserByNamePass(username, password);
    }

    @Override
    public User isExist(User user) {
        return userMapper.selectUserByNamePass(user.getUsername(), user.getPassword());
    }
}
